import {System, Unity, UnityEngine, lion} from 'csharp';
import {$ref, $unref, $generic, $promise, $typeof} from 'puerts';
import JsBehaviour, { GameObject } from 'lib/JsBehave';

class Main extends JsBehaviour {
    constructor(gameObject:GameObject){
        super(gameObject);
    }
    private obj:UnityEngine.GameObject;

    // 游戏 UI 相机
    public static uiCamera:UnityEngine.GameObject;

    // 游戏主相机
    public static mainCamera:UnityEngine.GameObject;

    Awake(){
        // 粒子效果
        this.obj = new UnityEngine.GameObject("效果");
        // this.obj.AddComponent($typeof(UnityEngine.Rigidbody));
        this.obj.AddComponent($typeof(UnityEngine.ParticleSystem));

        let obj:lion.JsLancher = lion.JsLancher.CreateLancher(this.obj,"B");

        // UI 相机
        Main.uiCamera = new UnityEngine.GameObject("ui_camera");
        Main.uiCamera.AddComponent($typeof(UnityEngine.Camera));

        // 相机
        Main.mainCamera = new UnityEngine.GameObject("main_camera");
        Main.mainCamera.AddComponent($typeof(UnityEngine.Camera));
        Main.mainCamera.transform.position = new UnityEngine.Vector3(-1.76, 6.92, -3.49);
        Main.mainCamera.transform.rotation = UnityEngine.Quaternion.Euler(24.361, 13.487, -6.281);
    }

    Start(){  
    }
    Update(delta:number){
    }
}
export default function (gameObject:GameObject){
    new Main(gameObject);
};